﻿<Window x:Class="RL.wStation"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Автостанция" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="361" d:DesignWidth="659" SizeToContent="WidthAndHeight" xmlns:my="clr-namespace:RL" Loaded="Window_Loaded" Closing="Window_Closing">
    <Window.Resources>
        <CollectionViewSource x:Key="stationViewSource" d:DesignSource="{d:DesignInstance my:Station, CreateList=True}" />
    </Window.Resources>
    <Grid DataContext="{StaticResource stationViewSource}">
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel Name="stackPanel1" Orientation="Horizontal">
            <Button Content="Сохранить" Height="23" Name="buttonSave" Width="75" Click="buttonSave_Click"/>
            <Button Content="Добавить" Height="23" Name="buttonAdd" Width="75" Click="buttonAdd_Click"/>
            <Button Content="Удалить" Height="23" Name="buttonDelete" Width="75" Click="buttonDelete_Click"/>
        </StackPanel>
        <DataGrid Grid.Row="1" AutoGenerateColumns="False" EnableRowVirtualization="True" ItemsSource="{Binding}" Name="stationDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected">
            <DataGrid.Columns>
                <DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=id}" Header="id" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=name}" Header="name" Width="300" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</Window>
